Copyright(C) 1994,1995,1996,1997 Terumasa KODAKA, Takeshi KONO


■ Calendar clock

Explanation  o The calendar clock is backed up by a battery, so if you turn
               off the power, the clock continues to operate.
             o Access to the calendar clock should be through the BIOS.
               It is best to avoid direct I/O access unless necessary.
             o The calendar clock LSI used varies depending on the model.
               ----------------+----------------------------------------------------------
               Calendar clock  | Model
               ----------------+----------------------------------------------------------
               μPD1990A        | PC-9801 first generation・E・F・M・U・VF・VM2・UV2,PC-98XA,PC-98LT
               ----------------+----------------------------------------------------------
               μPD4990A        | PC-9801VX2〜PC-9801NX/C,PC-9821Ce・Af
                               | Some lots of PC-9801NS/A,NL/R,PC-9821Bf・Cs2・Ce2
               ----------------+----------------------------------------------------------
               μPD4991         | PC-98HA
               ----------------+----------------------------------------------------------
               μPD4993         | PC-9801P・BA2・BS2・BX2,PC-9821Ne・Ap2・As2・Bp・Bs・Be・Ts
                               | Some lots
               ----------------+----------------------------------------------------------
               μPD4993A        | PC-9801P・NS/A・NL/R・BA2・BS2・BX2,PC-9821Ne・Ap2・As2・Bp・Bs・
                               | Some lots of Be・Bf・Ts・Cs2・Ce2
                               | PC-9821An・Ap3・As3・Xt・Xa・Xf・Xn・Xp・Xs・Xe・Cf・Cx・Cb・
                               | Xa16・Xa13・Xa12・Xa10・Xa9・Xa7・Xa7e・Xt16・Xt13・St15・St20・Ra20・
                               | Xv13・Xb10・Xc10・Xe10・V20・V16・V13・V12・V10・V7・
                               | Cx2・Cb2・Cx3・Cb3・
                               | Np・Ns・Ne2・Nd・Es・Ne3・Nd2・Nf・Nm・Ld・Lt・Ld2・Nx・Na12・Na9・Na7・
                               | Nb7・La10・La7
                               | PC-9821BA3・BX3・BX4
               ----------------+----------------------------------------------------------
               None            | DB-P1
               ----------------+----------------------------------------------------------
             u On a device equipped with μPD4993, if the date changes while the power is
               off, the year will not be updated or the setting for February 29th will not
               be performed automatically in a leap year.
             u In order to correct the above-mentioned problem in models equipped with
               μPD4993, NEC has released a patch for IO.SYS in MS-DOS 5.0A and earlier
               versions. It is also fixed in MS-DOS 6.2 and later and Windows 95 by
               including BCKWHEAT.SYS.
             o For models equipped with a calendar clock interrupt, it is possible to
               generate an INT 17h (IRQ15) interrupt to the CPU using the μPD4993A's pulse
               output.
             o For models equipped with calendar clock interrupts, it is possible to obtain
               the time in 1/100 second units using DOS functions by installing the device
               driver HRTIMER.SYS in the MS-DOS environment.

Related        I/O 000Ah bit 7
               INT 17h

I/O            0020h
Name           Calendar clock
Applicable to  All models (excluding PC-98HA, DB-P1)
Chip           μPD1990A, μPD4990A, μPD4993, μPD4993A
Function       ------------+-------+-----+-----------------------------------------------
               I/O address | width | R/W | content
               ------------+-------+-----+-----------------------------------------------
               0020h       | BYTE  | R   | μPD1990A and μPD4990A are not used.
                           |       |     | For machines equipped with μPD4993(A), it is used
                           |       |     | when I/O 0022h bit 4=1. details unknown.
               0020h       | BYTE  | W   | Set register
                           |       |     | bit 7,6: 00b
                           |       |     | bit 5: Data input
                           |       |     | bit 4: Clock
                           |       |     | bit 3: Strobe
                           |       |     | bit 2~0: C2~C0 command code
                           |       |     |   111b=Extended mode command (*1)
                           |       |     |   110b=TP=64Hz set (*1)
                           |       |     |   101b=TP=256Hz set (*1)
                           |       |     |   100b=TP=2048Hz set (*1)
                           |       |     |   011b=Time lead
                           |       |     |   010b=Time set & counter hold
                           |       |     |   001b=Register shift
                           |       |     |   000b=Register hold
                           |       |     |   *1: μPD1990A is not supported
               ------------+-------+-----+-----------------------------------------------
Explanation  o The data out terminal of the calendar clock IC is connected to system port B0.
             o Since the μPD1990A does not have a function to handle the year, the year value
               is stored in memory switch 8 (A000:3FFEh, E000:3FFEh) on devices equipped with
               the μPD1990A. For this reason, processing for new years and leap years is not
               performed automatically.

Related        I/O 0033h bit0
               I/O 8E1Eh ■ [PC-9801P]
               A000:3FFEh ■ [PC-9801 first generation・E・F・M・U・VM2・VF・UV2]
               INT 1Ch - Function 00h
               INT 1Ch - Function 01h

I/O            0022h
Name           Calendar clock control
               Undocumented
Target         μPD4993(A) equipped machine
Chip           μPD4993(A)
Function       ------------+-------+-----+-----------------------------------------------
               I/O address | width | R/W | content
               ------------+-------+-----+-----------------------------------------------
               0022h       | BYTE  | R/W | bit 4: μPD4993(A) mode setting
                           |       |     |   1=μPD4993 extended mode
                           |       |     |   0=μPD4990 compatibility mode
               ------------+-------+-----+-----------------------------------------------

Explanation  o It is thought to be used for control to enable/disable the extended functions
               of μPD4993(A). If bit 4=1, the calendar clock LSI cannot be accessed using
               normal methods.

Related        I/O 0020h

I/O            0022h,0023h
Name           Calendar clock
               Undocumented
Target         PC-98HA
Chip           μPD4991
Function       ------------+-------+-----+-----------------------------------------------
               I/O address | width | R/W | content
               ------------+-------+-----+-----------------------------------------------
               0022h       | BYTE  | W   | Addressing
                           |       |     |   bit 7~4: Unused (specify 0)
                           |       |     |   bit 3~0: A3~A0 address
               0023h       | BYTE  | R/W | Data input/output
                           |       |     |   bits 7 to 4: Unused (specify 0 when writing)
                           |       |     |   bit 3~0: D3~D0 input/output data
               ------------+-------+-----+-----------------------------------------------
Explanation  o The PC-98HA uses μPD4991 to implement the alarm function.
             u The μPD4991 performs I/O with the CPU using 4-bit address lines and 4-bit
               data lines. In the PC-98HA, the circuit is configured so that after
               outputting an address to I/O 0022h, data is input/output using I/O 0023h.
             o For details on μPD4991, refer to the manufacturer's data sheet.

Related        INT 1Ch - Function 00h
               INT 1Ch - Function 01h
               INT 1Ch - Function 07h
               INT 1Ch - Function 08h
               INT 1Ch - Function 09h


I/O            A98Eh,B98Eh
Name           Calendar clock
               Undocumented
Target         PC-9801P
Chip           μPD4991
Function       ------------+-------+-----+-----------------------------------------------
               I/O address | width | R/W | content
               ------------+-------+-----+-----------------------------------------------
               A98Eh       | BYTE  | W   | Addressing
                           |       |     |   bit 7~4: Unused (specify 0)
                           |       |     |   bit 3~0: A3~A0 address
               B98Eh       | BYTE  | R/W | Data input/output
                           |       |     |   bits 7 to 4: Unused (specify 0 when writing)
                           |       |     |   bit 3~0: D3~D0 input/output data
               ------------+-------+-----+-----------------------------------------------
Explanation  o The PC-9801P is designed to be able to be equipped with an additional
               μPD4991 in order to realize the wake-up function (however, in the actually
               shipped product, the printed pattern remains on the board, but the μPD4991
               is (Not implemented. BIOS support routines remain, but this feature does
               not work due to the lack of hardware).
             u The μPD4991 performs I/O with the CPU using 4-bit address lines and 4-bit
               data lines. In the PC-9801P, the circuit is configured so that after
               outputting an address to I/O A98Eh, data is input/output using I/O B98Eh.
             o For details on μPD4991, refer to the manufacturer's data sheet.

Related        INT 1Fh - Function 9A12~9A16h


I/O            0128h
Target         Models equipped with calendar clock interrupts
Function       [READ/WRITE]
                 bit 7~0: Details unknown
                   80h=
                   81h=
Description  o Controls the pulse output interrupt of the calendar clock IC.
             o Lower interrupt requests by reading.
             o Details unknown

Related        INT 17h
               INT 1Ch - Function 80h,81h
               INT 1Fh - Function 8Fh
               I/O 000Ah bit 7
               0000:04F1~04F3h